package cn.hf.mychat.common.poi;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 白高建
 * @create 2020/1/20 14:03
 */
public class ExcelResult<T> {
    private List<String> errors = new ArrayList();
    private List<String> warns = new ArrayList();
    private List<T> result = new ArrayList();

    public List<String> getErrors() {
        return errors;
    }

    public void setErrors(List<String> errors) {
        this.errors = errors;
    }

    public List<String> getWarns() {
        return warns;
    }

    public void setWarns(List<String> warns) {
        this.warns = warns;
    }

    public List<T> getResult() {
        return result;
    }

    public void setResult(List<T> result) {
        this.result = result;
    }

    public void error(int row, String colName, String value, String msg) {
        this.errors.add("第" + row + "行--列:" + colName + " 值:" + value + " 异常:" + msg);
    }
    public void addResult(T t) {
        if (this.result == null) {
            this.result = new ArrayList();
        }

        if (t != null) {
            this.result.add(t);
        }

    }

}

